﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Inner.Master" CodeBehind="testsearch.aspx.vb" Inherits="LecturerAppointmentSystem.testsearch" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Style.css" rel="stylesheet" type="text/css" />
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                        </asp:ToolkitScriptManager>

<table class="table" align="center">
                <tr class="tr">
                    <td align="right" class="style2" valign="top">
                        &nbsp;<asp:Label ID="lbl_Name" runat="server" AssociatedControlID="tb_Name" 
                            Text="Name: "></asp:Label>
                    </td>
                    <td align="left" class="style2" valign="top">
                        <br />
                        <asp:TextBox ID="tb_Name" runat="server"></asp:TextBox>
                    </td>
                    <td align="right" class="style2" valign="top">
                        &nbsp;<asp:Label ID="lbl_Date" runat="server" AssociatedControlID="tb_Date" 
                            Text="Date: "></asp:Label>
                    </td>
                    <td align="left" class="style2" valign="top">
                        <br />
                        <asp:TextBox ID="tb_Date" runat="server" AutoPostBack="true" Width="70%" OnTextChanged="validateDate"></asp:TextBox>
                        <asp:ImageButton ID="btn_Calendar" runat="server" Height="25px" ImageUrl="~/Images/calendarIcon.png"
                            Width="25px" />
                        <br />
                        <asp:CalendarExtender ID="tb_Date_CalendarExtender" runat="server" Enabled="True"
                            TargetControlID="tb_Date" PopupButtonID="btn_Calendar" Format="dd/MM/yyyy" SelectedDate="<%# Date.Today %>"
                            FirstDayOfWeek="Monday" Animated="true" OnClientDateSelectionChanged="checkDate">
                        </asp:CalendarExtender>
                        <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="tb_Date"
                            Display="Dynamic" ErrorMessage="Invalid Date" Operator="DataTypeCheck" Type="Date">
                        </asp:CompareValidator>
                        <br />
                        <asp:Label ID="lblDateError" runat="server"></asp:Label>
                        <br />
                    </td>
                </tr>
                <tr class="tr">
                    <td align="right" class="style2" valign="top">
                        &nbsp;</td>
                    <td align="left" class="style2" valign="top">
                    <asp:Button ID="btn_SearchByName" runat="server" Text="Search by Name" />
                    </td>
                    <td align="right" class="style2" valign="top">
                        &nbsp;</td>
                    <td align="left" class="style2" valign="top">
                    <asp:Button ID="btn_SearchByDate" runat="server" Text="Search by Date" />
                    </td>
                </tr>
                <tr class="tr">
                    <td align="right" class="style2" valign="top">
                        &nbsp;</td>
                    <td align="left" class="style2" valign="top">
                        &nbsp;</td>
                    <td align="right" class="style2" valign="top">
                        &nbsp;</td>
                    <td align="left" class="style2" valign="top">
                        &nbsp;</td>
                </tr>
                <tr class="tr">
                    <td align="right" valign="top">
                        <asp:Label ID="lbl_Faculty" runat="server" AssociatedControlID="ddl_Faculty" 
                            Text="Faculty: "></asp:Label>
                        &nbsp;&nbsp;
                    </td>
                    <td valign="top">
                        &nbsp;
                        <asp:DropDownList ID="ddl_Faculty" runat="server" DataSourceID="FacultyDataSource"
                            DataTextField="FacultyName" DataValueField="ID" AppendDataBoundItems="true">
                            <asp:ListItem Value="0">Any</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <tr >
                    <td>
                        &nbsp;</td>
                    <td>
                    
                    <asp:Button ID="btn_SearchByFaculty" runat="server" Text="Search by Faculty" />
                    
                    </td>
                    </tr>
            </table>

                <asp:SqlDataSource ID="FacultyDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:AppointmentsConnectionString %>"
                    ProviderName="<%$ ConnectionStrings:AppointmentsConnectionString.ProviderName %>"
                    
            SelectCommand="SELECT * FROM [Faculties] WHERE ([UniversityName] = ?)">
                    <SelectParameters>
                        <asp:SessionParameter Name="UniversityName" SessionField="universityname" 
                            Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
                
                <br />
    <table class="style1">
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
                
                </asp:Content>
